use solutiont8::millar_rabin;

pub fn min_edge_prime_num(number: u32) -> String {
    let mut prime_count = 0;
    let mut diagnoal = 1 as u64;
    for n in 1.. {
        let length = 2 * n + 1;
        let step = 2 * n;
        let diganoal_count = 4 * n + 1;
        for _ in 0..4 {
            diagnoal += step;
            if millar_rabin(diagnoal as u128) {
                prime_count += 1;
            }
        }
        if prime_count * 100 / diganoal_count < number as u64 {
            return dbg!(format!("{},{}", length, prime_count));
        }
    }
    unreachable!()
}
